<script setup>
import {useRoute, useRouter} from "vue-router";
import {onMounted, ref} from "vue";

const router = useRouter()
const route = useRoute()
const goIndex = () => {
    router.push('/index')
}
const status = ref('success')
const title = ref('提交成功,感谢您的支持。')
onMounted(() => {
    //从路由获取
    if (route.query.status) {
        if (route.query.status === '0'){
            status.value = 'error'
            title.value = '问卷暂未发布'
        }
        if (route.query.status === '2'){
            status.value = 'error'
            title.value = '问卷已关闭'
        }
    }

})
</script>

<template>
    <a-result class="pt-12" :status="status" :title="title" >
        <template #extra>
            <a-space>
                <a-button type='primary' @click="goIndex">返回首页</a-button>
            </a-space>
        </template>
    </a-result>
</template>

<style scoped>

</style>
